import request from '@/utils/request'

export const artGetChannelsService = () => request.get('/my/cate/list')

// 添加分类
export const artAddChannelsService = (data) =>
  request.post('/my/cate/add', data)

// 编辑分类
export const artEditChannelsService = (data) =>
  request.put('/my/cate/info', data)

// 删除文章分类
export const artDelChannelService = (id) =>
  request.delete('/my/cate/del', {
    params: { id }
  })
// 文章列表
export const artGetListService = (params) => {
  return request.get('/my/article/list', { params })
}
// 发布文章
export const artPublishService = (data) => {
  return request.post('/my/article/add', data)
}

// 文章详情
export const artGetDetailService = (id) => {
  return request.get('/my/article/info', { params: { id } })
}
// 编辑文章
export const artEditService = (data) => {
  request.put('/my/article/info', data)
}

export const artDelService = (id) =>
  request.delete('my/article/info', { params: { id } })
